package com.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/* 用户类 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("forum_user")
public class User implements Serializable {
    private String uname;
    private String upwd;
    private String nickName;
    private String headImg;
    private String motto;  /*个性签名*/
    private String email;
    private String birthday;
    private Date regTime;  // 注册时间  年月日 时分
    //    private String area_province;  /*所在地区（省）*/
//    private String area_city; /*所在地区（市）*/
    @TableField(exist = false) //非数据库字段属性
    private String[] area;
    private String areaProvince;
    private String areaCity;
    private String intro;
    private String role;

    /*通过areaProvince 和 areaCity来初始化 area */
    public void initArea(){
        this.setArea(new String[]{this.getAreaProvince(), this.getAreaCity()});
    }
}
